package com.wx.wxapp.controller;


import com.wx.wxapp.entity.Pet;
import com.wx.wxapp.service.PetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class PetController {
    @Autowired
    private PetService petService;

    @RequestMapping(value = "/pet",method = RequestMethod.GET)
    public List<Pet> GetAllPet(){
        return petService.getAllPet();
    }

    //获取用户添加的宠物信息
    @RequestMapping(value = "/getpet",method = RequestMethod.GET)
    public List<Pet> GetPet( @RequestParam("openid") String openid){
        return petService.getPet(openid);
    }
}
